<template>
  <el-row>
    <el-col :span="($attrs.note ? 4 : 24)">
      <el-switch v-bind="$attrs" v-on="$listeners" v-model="fieldValue"></el-switch>
    </el-col>
    <el-col v-if="$attrs.note" :span="18">
      <div  style="height:40px;line-height:40px;color:red;padding:0px 10px;">
        {{$attrs.note}}
      </div>
    </el-col>
  </el-row>
</template>

<script>
  export default {
    props: {
      value: {
        type: Boolean
      }
    },
    computed: {
      fieldValue: {
        get() {
          console.log(this.value);
          return this.value
        },
        set(val) {
          this.$emit('input', val)
        }
      }
    }
  }
</script>
